/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.route.system.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author neco
 */
@Entity
@Table(name = "rps_payment", schema = "public")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RpsPayment.findAll", query = "SELECT r FROM RpsPayment r"),
    @NamedQuery(name = "RpsPayment.findByPaymentId", query = "SELECT r FROM RpsPayment r WHERE r.paymentId = :paymentId"),
    @NamedQuery(name = "RpsPayment.findByPaymentCard", query = "SELECT r FROM RpsPayment r WHERE r.paymentCard = :paymentCard"),
    @NamedQuery(name = "RpsPayment.findByPaymentDuration", query = "SELECT r FROM RpsPayment r WHERE r.paymentDuration = :paymentDuration"),
    @NamedQuery(name = "RpsPayment.findByPaymentFullFare", query = "SELECT r FROM RpsPayment r WHERE r.paymentFullFare = :paymentFullFare"),
    @NamedQuery(name = "RpsPayment.findByPaymentFirstPassingFare", query = "SELECT r FROM RpsPayment r WHERE r.paymentFirstPassingFare = :paymentFirstPassingFare"),
    @NamedQuery(name = "RpsPayment.findByPaymentSecondPassingFare", query = "SELECT r FROM RpsPayment r WHERE r.paymentSecondPassingFare = :paymentSecondPassingFare"),
    @NamedQuery(name = "RpsPayment.findByPaymentThirdPassingFare", query = "SELECT r FROM RpsPayment r WHERE r.paymentThirdPassingFare = :paymentThirdPassingFare"),
    @NamedQuery(name = "RpsPayment.findByPaymentFourthPassingFare", query = "SELECT r FROM RpsPayment r WHERE r.paymentFourthPassingFare = :paymentFourthPassingFare"),
    @NamedQuery(name = "RpsPayment.findByPaymentFifthPassingFare", query = "SELECT r FROM RpsPayment r WHERE r.paymentFifthPassingFare = :paymentFifthPassingFare")})
public class RpsPayment implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "payment_id", nullable = false)
    private Integer paymentId;
    @Size(max = 200)
    @Column(name = "payment_card", length = 200)
    private String paymentCard;
    @Basic(optional = false)
    @NotNull
    @Column(name = "payment_duration", nullable = false)
    private double paymentDuration;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "payment_full_fare", precision = 17, scale = 17)
    private Double paymentFullFare;
    @Column(name = "payment_first_passing_fare", precision = 17, scale = 17)
    private Double paymentFirstPassingFare;
    @Column(name = "payment_second_passing_fare", precision = 17, scale = 17)
    private Double paymentSecondPassingFare;
    @Column(name = "payment_third_passing_fare", precision = 17, scale = 17)
    private Double paymentThirdPassingFare;
    @Column(name = "payment_fourth_passing_fare", precision = 17, scale = 17)
    private Double paymentFourthPassingFare;
    @Column(name = "payment_fifth_passing_fare", precision = 17, scale = 17)
    private Double paymentFifthPassingFare;
    @OneToMany(mappedBy = "detailPayment")
    private List<RpsRoutePaymentDetail> rpsRoutePaymentDetailList;

    public RpsPayment() {
    }

    public RpsPayment(Integer paymentId) {
        this.paymentId = paymentId;
    }

    public RpsPayment(Integer paymentId, double paymentDuration) {
        this.paymentId = paymentId;
        this.paymentDuration = paymentDuration;
    }

    public Integer getPaymentId() {
        return paymentId;
    }

    public void setPaymentId(Integer paymentId) {
        this.paymentId = paymentId;
    }

    public String getPaymentCard() {
        return paymentCard;
    }

    public void setPaymentCard(String paymentCard) {
        this.paymentCard = paymentCard;
    }

    public double getPaymentDuration() {
        return paymentDuration;
    }

    public void setPaymentDuration(double paymentDuration) {
        this.paymentDuration = paymentDuration;
    }

    public Double getPaymentFullFare() {
        return paymentFullFare;
    }

    public void setPaymentFullFare(Double paymentFullFare) {
        this.paymentFullFare = paymentFullFare;
    }

    public Double getPaymentFirstPassingFare() {
        return paymentFirstPassingFare;
    }

    public void setPaymentFirstPassingFare(Double paymentFirstPassingFare) {
        this.paymentFirstPassingFare = paymentFirstPassingFare;
    }

    public Double getPaymentSecondPassingFare() {
        return paymentSecondPassingFare;
    }

    public void setPaymentSecondPassingFare(Double paymentSecondPassingFare) {
        this.paymentSecondPassingFare = paymentSecondPassingFare;
    }

    public Double getPaymentThirdPassingFare() {
        return paymentThirdPassingFare;
    }

    public void setPaymentThirdPassingFare(Double paymentThirdPassingFare) {
        this.paymentThirdPassingFare = paymentThirdPassingFare;
    }

    public Double getPaymentFourthPassingFare() {
        return paymentFourthPassingFare;
    }

    public void setPaymentFourthPassingFare(Double paymentFourthPassingFare) {
        this.paymentFourthPassingFare = paymentFourthPassingFare;
    }

    public Double getPaymentFifthPassingFare() {
        return paymentFifthPassingFare;
    }

    public void setPaymentFifthPassingFare(Double paymentFifthPassingFare) {
        this.paymentFifthPassingFare = paymentFifthPassingFare;
    }

    @XmlTransient
    public List<RpsRoutePaymentDetail> getRpsRoutePaymentDetailList() {
        return rpsRoutePaymentDetailList;
    }

    public void setRpsRoutePaymentDetailList(List<RpsRoutePaymentDetail> rpsRoutePaymentDetailList) {
        this.rpsRoutePaymentDetailList = rpsRoutePaymentDetailList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (paymentId != null ? paymentId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RpsPayment)) {
            return false;
        }
        RpsPayment other = (RpsPayment) object;
        if ((this.paymentId == null && other.paymentId != null) || (this.paymentId != null && !this.paymentId.equals(other.paymentId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.route.system.entity.RpsPayment[ paymentId=" + paymentId + " ]";
    }
    
}
